<html>
<head><meta charset="utf-8"><title>multiple matching crates · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html">multiple matching crates</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216590414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216590414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216590414">(Nov 13 2020 at 10:02)</a>:</h4>
<p>We have reached "peak multiple-matching-crates": CI is now encountering this, too: </p>
<div class="codehilite"><pre><span></span><code>+error[E0464]: multiple matching crates for `serde_derive`
+  --&gt; $DIR/used_underscore_binding_macro.rs:4:1
+   |
+LL | extern crate serde_derive;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: candidates:
+           crate `serde_derive`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-68823e1c401e486b.so
+           crate `serde_derive`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libserde_derive-4b65394b709f9e2e.so
</code></pre></div>



<a name="216590476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216590476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216590476">(Nov 13 2020 at 10:03)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/78399#issuecomment-726641988">https://github.com/rust-lang/rust/pull/78399#issuecomment-726641988</a> added a usage of <code>serde_derive</code> to the compiler</p>



<a name="216591053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216591053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216591053">(Nov 13 2020 at 10:09)</a>:</h4>
<p>I wonder if <a href="https://github.com/dtolnay/trybuild">https://github.com/dtolnay/trybuild</a> will have fewer problems (and whether we can make it use <code>clippy-driver</code> at all)</p>



<a name="216608669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216608669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216608669">(Nov 13 2020 at 13:20)</a>:</h4>
<p>Maybe try loading serde_derive from sysroot instead of compiling your own version?</p>



<a name="216612866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216612866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216612866">(Nov 13 2020 at 13:52)</a>:</h4>
<p>I think that only works for builds within rustc</p>



<a name="216612890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216612890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216612890">(Nov 13 2020 at 13:52)</a>:</h4>
<p>but that may be worth a try, we do check for in-tree builds already anyway</p>



<a name="216623678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216623678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216623678">(Nov 13 2020 at 15:06)</a>:</h4>
<p>Could you please elaborate on what the fix is?</p>



<a name="216623876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216623876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216623876">(Nov 13 2020 at 15:08)</a>:</h4>
<p><code>extern crate serde_derive;</code>, without adding anything to Cargo.toml</p>



<a name="216624072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624072">(Nov 13 2020 at 15:10)</a>:</h4>
<p>thanks!</p>



<a name="216624127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624127">(Nov 13 2020 at 15:11)</a>:</h4>
<p>is there an explanation why this works, that i can look up? (i.e. explanation of sysroot)</p>



<a name="216624151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624151">(Nov 13 2020 at 15:11)</a>:</h4>
<p>not yet: <a href="https://github.com/rust-lang/rustc-dev-guide/issues/953">https://github.com/rust-lang/rustc-dev-guide/issues/953</a></p>



<a name="216624165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624165">(Nov 13 2020 at 15:11)</a>:</h4>
<p>but see the links in that issue for discussion</p>



<a name="216624189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624189">(Nov 13 2020 at 15:11)</a>:</h4>
<p>oh, wow. it's a popular issue <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="216624457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624457">(Nov 13 2020 at 15:14)</a>:</h4>
<p>will <code>serde_derive</code> end up in the <code>rustc-dev</code> rustup component?</p>



<a name="216624518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624518">(Nov 13 2020 at 15:14)</a>:</h4>
<p>I don't know, that's a question for <span class="user-mention" data-user-id="116122">@simulacrum</span></p>



<a name="216624546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624546">(Nov 13 2020 at 15:14)</a>:</h4>
<p>because otherwise this fix will break clippy in its own repo</p>



<a name="216624585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624585">(Nov 13 2020 at 15:14)</a>:</h4>
<p>it should, I expect, already be there</p>



<a name="216624623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624623">(Nov 13 2020 at 15:15)</a>:</h4>
<p>hm no doesn't seem to be</p>



<a name="216624638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624638">(Nov 13 2020 at 15:15)</a>:</h4>
<p>but if rustc starts using it it'll appear</p>



<a name="216624737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624737">(Nov 13 2020 at 15:16)</a>:</h4>
<p>Oh wait. serde is a dependency of the crate I'm using (a transient dep, is that the right word?)</p>



<a name="216624885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216624885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216624885">(Nov 13 2020 at 15:17)</a>:</h4>
<p>I would not expect you to change it, but rather clippy</p>



<a name="216625030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216625030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216625030">(Nov 13 2020 at 15:18)</a>:</h4>
<p>I can look more later, there's definitely a solution though</p>



<a name="216668063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216668063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216668063">(Nov 13 2020 at 20:24)</a>:</h4>
<p>Part of the problem here is that compiletest is bad with this</p>



<a name="216668082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216668082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manish Goregaokar <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216668082">(Nov 13 2020 at 20:25)</a>:</h4>
<p>cargo links dependencies to actual rlib files but i don't think compiletest does</p>



<a name="216668246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216668246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216668246">(Nov 13 2020 at 20:26)</a>:</h4>
<p>compiletest does? What do you mean by that?</p>



<a name="216668278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216668278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216668278">(Nov 13 2020 at 20:27)</a>:</h4>
<p>like, I'm almost certain the auxiliary file crates are --extern'd, they're not put in a sysroot</p>



<a name="216668313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/216668313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#216668313">(Nov 13 2020 at 20:27)</a>:</h4>
<p>and regular crates (e.g., serde_derive) are loaded from the sysroot but nothing else should be in the load path there so that should be fine</p>



<a name="218206246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/218206246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vn-ki <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#218206246">(Nov 29 2020 at 10:24)</a>:</h4>
<p>Did any updates regarding this happen?</p>



<a name="218217394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/multiple%20matching%20crates/near/218217394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/multiple.20matching.20crates.html#218217394">(Nov 29 2020 at 15:35)</a>:</h4>
<p><span class="user-mention" data-user-id="355545">@Vishnunarayan K. I.</span> <a href="#narrow/stream/257328-clippy/topic/multiple.20matching.20crates/near/216624127">said</a>:</p>
<blockquote>
<p>is there an explanation why this works, that i can look up? (i.e. explanation of sysroot)</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rustc-dev-guide/pull/976">https://github.com/rust-lang/rustc-dev-guide/pull/976</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>